<template>
	<view class="content">
		<swiper class="swiper" :autoplay="autoplay" :duration="duration">
			<swiper-item>
				<view class="swiper-item">
					<view class="swiper-item-img">
						<image src="../../static/waybIll/guide1.png" mode="aspectFit"></image>
					</view>
					<view class="textTips">
						准时送达，全程无忧
					</view>
					<view class="circleBox">
						<view class="circleList circleNew">
						</view>
						<view class="circleList">
						</view>
						<view class="circleList">
						</view>
					</view>
				</view>
				<!-- <view class="jump-over" @tap="launchFlag()">{{jumpover}}</view> -->
			</swiper-item>
			<swiper-item>
				<view class="swiper-item">
					<view class="swiper-item-img">
						<image src="../../static/waybIll/guide2.png" mode="aspectFit"></image>
					</view>
					<view class="textTips">
						优质车源，诚信所托
					</view>
					<view class="circleBox">
						<view class="circleList">
						</view>
						<view class="circleList circleNew">
						</view>
						<view class="circleList">
						</view>
					</view>
				</view>
				<!-- <view class="jump-over" @tap="launchFlag()">{{jumpover}}</view> -->
			</swiper-item>
			<swiper-item>
				<view class="swiper-item">
					<view class="swiper-item-img">
						<image src="../../static/waybIll/guide3.png" mode="aspectFit"></image>
					</view>
					<view class="textTips">
						智能匹配，贴心服务
					</view>
				</view>
				<view class="circleBox btnBox">
					<view class="btn" @click="jump()">
						立即体验
					</view>
				</view>
				<!-- <view class="jump-over" @tap="launchFlag()">{{jumpover}}</view> -->
			</swiper-item>
		</swiper>

	</view>
</template>

<script>
	import Cache from '@/utils/cache'
	export default {
		name: 'guide',
		data() {
			return {
				background: ['color1', 'color2', 'color3'],
				autoplay: false,
				duration: 500,
				jumpover: '跳过',
				experience: '立即体验'
			}
		},
		methods: {
			/**
			 * 向本地存储中设置launchFlag的值，即启动标识；
			 */
			jump() {
				Cache.set("LAUNCHFLAG", true, 59 * 24 * 60 * 60);
				if (Cache.get('TOKEN')) {
					uni.redirectTo({
						url: '/pages/home/home'
					});
				} else {
					uni.redirectTo({
						url: '/pages/login/index'
					});
				}
			}
		}
	}
</script>
<style>
	page {
		width: 100%;
		height: 100%;
		background-size: 100% auto;
		padding: 0;
	}
	.content {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		width: 100vw;
		height: 100vh;
		background-size: 100% auto;
		padding: 0;
	}

	.swiper {
		width: 100%;
		height: 100%;
		background: #FFFFFF;
	}

	.swiper-item {
		width: 100%;
		height: 100%;
		text-align: center;
		position: relative;
		display: flex;
		/* justify-content: center; */
		align-items: center;
		flex-direction: column-reverse;

	}

	.swiper-item-img {
		width: 100%;
		height: 100%;
		margin: 0 auto;
	}

	.swiper-item-img image {
		width: 100%;
		height: 70%;
	}

	.uniapp-img {
		height: 20%;
		background: #FFFFFF;
		display: flex;
		justify-content: center;
		align-items: center;
		overflow: hidden;
	}

	.uniapp-img image {
		width: 40%;
	}

	.jump-over,
	.experience {
		position: absolute;
		height: 60upx;
		line-height: 60upx;
		padding: 0 40upx;
		border-radius: 30upx;
		font-size: 32upx;
		color: #454343;
		border: 1px solid #454343;
		z-index: 999;
	}

	.jump-over {
		right: 45upx;
		top: 125upx;
	}

	.experience {
		right: 50%;
		margin-right: -105upx;
		bottom: 0;
	}

	.textTips {
		position: absolute;
		top: 1000rpx;
		font-size: 44rpx;
		font-family: PingFangSC-Medium, PingFang SC;
		font-weight: 500;
		color: #333333;
		z-index: 999;
	}

	.circleBox {
		position: absolute;
		display: flex;
		bottom: 140rpx;
	}

	.circleList {
		height: 20rpx;
		width: 20rpx;
		border-radius: 50%;
		margin-right: 40rpx;
		background: #DFE1E6;
	}

	.circleNew {
		background: #00468C;
	}

	.btnBox {
		left: 50%;
		margin-left: -126rpx;
	}

	.btn {
		height: 72rpx;
		width: 232rpx;
		text-align: center;
		line-height: 72rpx;
		color: #00468C;
		border: 2rpx solid #00468C;
		border-radius: 36rpx;
		margin: 0 auto;
	}
</style>
